package com.itheima.datastream;

import java.io.*;

public class Test2 {

    public static void main(String[] args) {

        //特殊数据流：常用于通信

        try (
                //允许把数据和类型一起读取
                DataInputStream dis = new DataInputStream(new FileInputStream("io\\src\\data.txt"));
        ) {

            //读取顺序要和写入的顺序一致
            System.out.println(dis.readInt());
            System.out.println(dis.readDouble());
            System.out.println(dis.readBoolean());
            System.out.println(dis.readChar());
            System.out.println(dis.readUTF());

        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}
